package com.youxuan.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.youxuan.mapper.OrderGoodsMapper;
import com.youxuan.pojo.entity.OrderGoods;
import com.youxuan.service.OrderGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGoods> implements OrderGoodsService {

    @Autowired
    private OrderGoodsMapper orderGoodsMapper;

    @Override
    public List<OrderGoods> getGoodsListByOid(String orderCode) {
        LambdaQueryWrapper<OrderGoods> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(OrderGoods::getOrderCode, orderCode);
        List<OrderGoods> orderGoodsList = orderGoodsMapper.selectList(queryWrapper);
        return orderGoodsList;
    }
}
